<?php
class DashboardController extends Zend_Controller_Action
{
	public function indexAction()
	{
		if(null == ($identity = Blogger_Auth::getInstance()->getIdentity()))
			throw new Blogger_Exception('Authentication failure', -4);
		$this->view->identity = $identity;
		$this->view->messages = $this->_helper->flashMessenger->getMessages();
		$postsModel = new Blogger_Posts();
		$paginator = $postsModel->getPaginatedPostsByUserId($identity['id']);
		$pageNumber = $this->_getParam('page');
		if(!empty($pageNumber))
			$paginator->setCurrentPageNumber($pageNumber);
		$this->view->postsPaginator = $paginator;
	}
	
	
}